<template>
  <div class="focusbox">
    <div class="topbox">
      <div class="iconBox" @click.stop="showsidebar">
        <i class="iconfont icon-hanbaocaidan"></i>
      </div>
      <div class="title">动态</div>
    </div>
    <div class="personfacebox swiper-face">
      <div class="swiper-wrapper">
        <div class="minbox swiper-slide" v-for="ele in follow" :key="ele.userId">
          <div class="imgbox">
            <img :src="ele.avatarUrl" alt />
          </div>
          <div class="namebox van-ellipsis">{{ele.nickname}}</div>
        </div>
      </div>
    </div>
    <div class="content">
      <div class="contenttop">
        <div>我的关注</div>
        <div class="detailtopright">
          <div :class="{'con':followSortType==1}" @click.stop="change(1)">朋友</div>
          <div>&nbsp;|&nbsp;</div>
          <div :class="{'con':followSortType==2}" @click.stop="change(2)">音乐人</div>
        </div>
      </div>
      <div class="contentbottom">
        <div v-show="followSortType==1">关注的人近30天内没有动态</div>
        <div v-show="followSortType==2">关注的音乐人近30天没有动态</div>
      </div>
    </div>
  </div>
</template>

<script>
import Swiper from "swiper";
import { getfollow } from "../assets/api/focus.js";
export default {
  props: ["personalid"],
  data() {
    return {
      show: true,
      follow: [],
      followSortType: 1,
    };
  },
  methods: {
    change(type) {
      this.followSortType = type;
    },
    showsidebar() {
      this.$emit("showsidebarson");
    },
  },
  created() {
    getfollow({ uid: this.personalid }).then((data) => {
      this.follow = data.follow;
    });
  },
  mounted() {
    new Swiper(".swiper-face", {
      pagination: ".swiper-pagination",
      slidesPerView: 5,
      paginationClickable: true,
      spaceBetween: 25,
      observer: true,
      observeParents: true,
    });
  },
};
</script>

<style lang="less">
.focusbox {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  overflow: scroll;

  .topbox {
    height: 60px;
    backdrop-filter: blur(15px);
    background-color: rgba(255, 255, 255, 0.01);
    background-blend-mode: multiply;
    line-height: 60px;
    display: flex;
    color: white;
    align-items: center;
    padding: 0 16px;
    .iconBox {
      flex: 0 0 24px;
      padding: 0;
      margin: 0;
      i {
        font-size: 24px;
      }
    }
    .title {
      flex: 1;
      text-align: center;
      font-size: 20px;
    }
  }
  .personfacebox {
    overflow: hidden;
    display: flex;
    padding: 0 15px;
    margin-top: 15px;
    .minbox {
      text-align: center;
      margin-right: 18px;
      .imgbox {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        overflow: hidden;
        img {
          width: 100%;
        }
      }
      .namebox {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.9);
        margin-top: 8px;
      }
    }
  }
  .content {
    padding: 14px 16px;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.9);
    padding-bottom: 80px;
    .contenttop {
      display: flex;
      justify-content: space-between;
      .detailtopright {
        color: rgba(255, 255, 255, 0.5);
        display: flex;
        .con {
          color: rgba(255, 255, 255, 0.9);
        }
      }
    }
    .contentbottom {
      margin-top: 200px;
      text-align: center;
      color: rgba(255, 255, 255, 0.5);
      letter-spacing: 1px;
    }
  }
}
</style>